// routes/homeRoutes.js
import {
  getHomes,
  getHomeById,
  getHomeByCategories,
  addHomePageData,
  deleteHomeById,
  updateHomePageData
} from "../controllers/homeController.js";
import Router from "koa-router";

const router = new Router({ prefix: "/api/home-page" });

// 获取全部
router.get("/", getHomes);
// 根据id获取详情
router.get("/:id", getHomeById);
// 根据分类获取数据
router.get("/categories/:categories", getHomeByCategories);
// 添加
router.post("/addHomePageData", addHomePageData);
// 删除
router.get("/deleteHomeById/:id", deleteHomeById);
// 修改
router.post("/updateHomePageData", updateHomePageData);

export default router;
